package cn.e3mall.portal.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.dubbo.config.annotation.Reference;

import cn.e3mall.content.service.ContentService;
import cn.e3mall.pojo.TbContent;

/**
 * 首页暂时Controller
 * */
@Controller
public class IndexController {

	@Reference(timeout=5000000)
	ContentService contentService;
	
	@Value("${CONTENT_LUNBO_ID}")
	private Integer CONTENT_LUNBO_ID;
	
	@RequestMapping("/index")
	public String showIndex(Model model){
		//查询内容列表，首页展示的几个大广告，redis缓存
		List<TbContent> ad1List=(List<TbContent>) contentService.getContentListByCid(CONTENT_LUNBO_ID);
		//结果传递给页面
		model.addAttribute("ad1List",ad1List);
		return "index";
	}
}
